package com.example.demo.config.scheduler;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by Mojo on 2017/9/7.
 * 实现各个任务job
 */
public class ScheduledJob implements Job {

	private SimpleDateFormat dateFormat() {
		return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	}

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		System.out.println("The time is now " + dateFormat().format(new Date()));
	}

}
